import 'package:flutter/material.dart';
import 'package:x3_base_package/x3_base_package.dart';
import 'package:x3_business_core/x3_business_core.dart';

/// 作者：william on 2021/3/11 18:22
/// 邮箱：362661044@qq.com

/// 做单的服务
class BusinessDetailedOrderService {
  /// 网关名称
  final String gateway;

  /// 主单名称
  String billsName;

  /// 主单id
  String billsId;

  /// 区店: 0 店店: 1
  String groupType;

  /// 当前身份 创建人:1 执行人:2 3:抄送人
  String userType = '';

  Map<String, String> get billsIdMap => {'billsId': billsId};

  /// 查询主单
  BaseScreenRequestModel queryMainService;

  /// 保存更新主单服务
  BaseScreenRequestModel saveMainService;

  /// 提交主单服务
  BaseScreenRequestModel sureMainService;

  /// 删除主单
  BaseScreenRequestModel delMainService;

  /// 明细tab
  List<BusinessTabNestedConfig> tabs;

  BusinessDetailedOrderService({
    @required this.gateway,
    @required this.billsName,
    @required this.tabs,
    @required BaseScreenRequestModel queryMainService,
    @required BaseScreenRequestModel saveMainService,
    @required BaseScreenRequestModel sureMainService,
    @required BaseScreenRequestModel delMainService,
    this.billsId,
  }) {
    this.queryMainService = BaseScreenRequestModel(this.gateway + queryMainService.path, method: queryMainService.method, params: queryMainService.params);
    this.saveMainService = BaseScreenRequestModel(this.gateway + saveMainService.path, method: saveMainService.method, params: saveMainService.params);
    this.sureMainService = BaseScreenRequestModel(this.gateway + sureMainService.path, method: sureMainService.method, params: sureMainService.params);
    this.delMainService = BaseScreenRequestModel(this.gateway + delMainService.path, method: delMainService.method, params: delMainService.params);
  }
}
